package domains.minnovar.objects

import static org.groovymud.utils.WordUtils.*

import static org.groovymud.utils.MessengerUtils.sendMessageToRoom
import org.groovymud.object.combat.AbstractAttack

import org.groovymud.object.alive.AbstractMOB
import impl.guild.Newbie
import impl.races.Human
import org.groovymud.utils.Dice

class TownCrier extends AbstractMOB{
	void initialise() {
		setName("Town Crier")
		addShortName("crier")        
		setGender("male")
		setGuildBehaviour(new Newbie())
		setRaceBehaviour(new Human(this))
		setRequiresIndefinateArticle(true)
	}
	/**
	 * The mob heartbeat is called every mud tick.
	 * 
	 */
	void doHeartBeat() {
		Dice dice = new Dice(1, 100)
		def rnd = dice.roll()
		if((0..5).contains(rnd)){
			sendMessageToRoom this, "", "The ${getName()} shuffles ${resolvePossessiveGender(getGender())} feet."            
		}
		if((6..10).contains(rnd)){
			sendMessageToRoom this, "", "The ${getName()} shouts: O Yay, O Yay!."
		}
	}
	/**
	 * this method affects the damage done by an attack, before it reports the damage to the mob
	 * you can negate any damage whatsoever in this method based on attacktype or whatever you want!
	 * 
	 */
	public long doDefend(AbstractAttack nextAttack, long damage, long attackToHit, long roll){
		
	}
}